#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.basic.security.oauth2.inter.impl;

import ${package}.basic.security.oauth2.config.YkSecurityProperties;
import ${package}.basic.security.oauth2.inter.AuthorizeConfigProvider;
import lombok.AllArgsConstructor;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.stereotype.Component;

/**
 * Description:
 * 实现链接权限配置接口
 *
 * @author wupanhua
 * @date 2019-09-01 17:24
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Component
@AllArgsConstructor
@Order(Integer.MIN_VALUE)
public class AuthorizeConfigProviderImpl implements AuthorizeConfigProvider {

    /**
     * 云科oAuth2自定义鉴权模式配置
     */
    private YkSecurityProperties ykSecurityProperties;

    /**
     * Description:
     * <鉴权模块本身需要实现这个方法>
     * @author wupanhua
     * @date 17:25 2019-09-01

     * @return void
     */
    @Override
    public void config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
        String[] allowPath = ykSecurityProperties.getAllowPath();
        config.antMatchers(allowPath).permitAll();
    }
}
